package TestJava;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MapTest {
    static Map<String, Integer> Human = new HashMap<>();
    static ArrayList<Integer> mathList = new ArrayList<>();

    public static void main(String args[]){
        someMap();
        exitMap();

        for (int i = 1; i <= 10 ; i++){
            mathList.add(i);
        }

        for (int num : mathList){
            System.out.println(num);
        }
    }

    public static void someMap(){
        Human.put("爱德华", 35);
        Human.put("刘德华", 40);

        Human.put("小明", 18);
        Human.put("马子轩", 19);
    }

    public static void exitMap(){

        Human.forEach((name, age) -> {
            if (age >= 35 || age <= 20) {
                System.out.println(name + " > " + age);
            }
        });
    }
}
